package com.ir;

import com.sysdep.CodeGenerator;

public class Return extends Stmt {
    Expr expr;

    public Return(Expr expr) {
        this.expr = expr;
    }

    public Expr getExpr() {
        return expr;
    }

    public void accept(CodeGenerator cg) {
        cg.visit(this);
    }

    @Override
    public String getString() {
        if(expr == null) {
            return "Return";
        }
        else
            return "Return-" + expr.toString();
    }
}
